<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
    <link href="../lib/metro.css" rel="stylesheet">

    <title>Test Donut - Metro UI :: Popular HTML, CSS and JS library</title>

</head>
<body class="m4-cloak">
<div class="container">
    <h1>Donut test page</h1>

    <div class="example">
        <div class="row">
            <div class="cell-md-3">
                <div class="mx-auto" id="donut1" data-role="donut" data-value="35" data-show-value="true" data-cap=""></div>
            </div>
            <div class="cell-md-3">
                <div class="mx-auto" id="donut2" data-role="donut" data-value="35" data-hole="0" data-stroke="transparent" data-fill="#4CAF50" data-animate="500"></div>
            </div>
            <div class="cell-md-3">
                <div class="mx-auto" id="donut3" data-role="donut" data-value="35" data-hole=".6" data-stroke="#f5f5f5" data-fill="#9C27B0" data-animate="500"></div>
            </div>
            <div class="cell-md-3">
                <div class="mx-auto" id="donut4" data-role="donut" data-value="35" data-stroke="#F44336" data-fill="#FFC107" data-color="#FFFFFf" data-cap="" data-animate="500" data-background="#4fc3f7" data-font-size="32"></div>
            </div>
        </div>
    </div>

    <div>
        <button class="button" onclick="changeColor()">Change Color</button>
    </div>
</div>

<script src="../lib/metro.js"></script>
<script>
    function changeColor(){
        var donut = Metro.getPlugin('#donut3', 'donut');
        donut.setColor({
            "stroke": "#000"
        })
        console.log(donut.options)
    }

    $(function(){
        setInterval(function(){
            var i, d;
            for (i = 0; i < 4; i++) {
                d = $.random(0,100);
                Metro.getPlugin('#donut'+(i+1), 'donut').val(d);
            }
        }, 2000);
    });
</script>
</body>
</html>
